<script type="text/javascript">
var content = null;
$(function () {
	if(CKEDITOR.instances['content']) 
		CKEDITOR.remove(CKEDITOR.instances['content']);
	
	var uploadParm = {
		height:'150px',
		filebrowserBrowseUrl:'${contextPath}browse-file.html',
		filebrowserImageBrowseUrl:'${contextPath}browse-image.html',
		filebrowserUploadUrl:'${contextPath}m/supplyinfo-upload.html?type=file',
		filebrowserImageUploadUrl:'${contextPath}m/supplyinfo-upload.html?type=image',
		language:'zh-cn',
	}
	content = CKEDITOR.replace('content', uploadParm);
	addFilesUploadEvent_SupplyInfo();
});
</script>
<#import "/freemarker/datetime.ftl" as dt>
<div class="widget" style="float:left; width:720px;">
	<div class="widget-header">
		<h3 class="title"><i class="fontello-icon-th-list-1"></i>供应信息编辑</h3>
	</div>
	<div class="widget-content">
		<form id="editSupplyInfoForm">
			<table class="table boo-table table-content" style="width:100%; text-align:left;">
			<input type="hidden" name="oc" value="${(cu_organCode)!''}"/>
				<tr>
					<td>标题</td>
					<td>
						<div class="input-group">
							<span class="btn-group">
								<input type="hidden" name="fileCode" id="fileCode" /> 
								<input type="hidden" id="code" name="code" value="${(si.code)!''}"/>
								<input type="text" id="title" name="title" value="${(si.title)!''}"  style="width:300px"/>
							</span>
						</div>
					</td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">品牌</td>
					<td><input type="text" id="brand" name="brand" style="width:300px;" value="${(si.brand)!''}" /></td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">规格</td>
					<td><input type="text" id="norm" name="norm" style="width:300px;" value="${(si.norm)!''}" /></td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">数量</td>
					<td><input type="text" id="num" name="num" style="width:300px;" value="${(si.num)!''}" /></td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">价格</td>
					<td><input type="text" id="price" name="price" style="width:300px;" value="${(si.price)!''}" /></td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">地址</td>
					<td><input type="text" id="address" name="address" style="width:300px;" value="${(si.address)!''}" /></td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">截止时间</td>
					<td>
						<#if si??>
							<@dt.dateTime name="stopTime" value=si.stopTime width="280px"/>
						<#else>
							<@dt.dateTime name="stopTime"  width="240px"/>
						</#if>	
					</td>
				</tr>
				<tr>
					<td class="table-left" style="width:120px;">详细类容</td>
					<td>
						<textarea id="content"  style="width:600px;">${(si.content)!''}</textarea>
					</td>
				</tr>
				<tr>
					<td class="table-left">封面图片<a id="uploadFilesBtn" href="javascript:;">[选择]</a></td>
					<td id="annexListTable">
						<#if list??>
							<#list list as sa>
								<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
									<input type="radio" name="choose"  value="${sa.code}" <#if sa.cover=="true">checked="checked"</#if> />
									<input type="hidden" name="list[${sa_index}].code" value="${sa.code}" />
									<button type="button" class="close" data-dismiss="alert" onclick="javascript:deleteSelectedItem($(this));">&times;</button>
									<a class="title" target="_blank" href="${contextPath}upload/supplyInfoAnnex/${sa.sn}.${sa.ext}">${sa.name}</a>
								</div>
							</#list>
						</#if>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:center;">
						<a href="javascript:;" class="btn btn-info" onclick="javascript:checkedSupplyInfo();">
							<i class="fontello-icon-mail-4"></i>&nbsp;保&nbsp;&nbsp;存
						</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="javascript:;" class="btn btn-info" onclick="javascript:sys_load_handle('supplyinfo');">
							<i class="fontello-icon-block"></i>&nbsp;取&nbsp;&nbsp;消
						</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>


<div id="tempAnnexListDiv" style="display:none;">
	<div class="filter-table rep" style="margin-left:5px; margin-bottom:0px;">
		<input class="name" type="hidden" />
		<input class="size" type="hidden" />
		<input class="sn" type="hidden"  />
		<input class="ext" type="hidden"  />
		<input id="afcs" class="afcs" type="hidden" name="afcs" />
		<input type="radio" name="choose" class="font-cover"   checked="checked"/>
		<button type="button"  class="close" data-dismiss="alert" onclick="javascript:deleteSelectedItem($(this));">&times;</button>
		<a class="title" href="#"></a>
	</div>
</div>
<input type="hidden" id="supplyinfo_an_index" value="${(list?size)!'0'}" />